home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / poppar.z / poppar
Encoding:
Text File  |  2002-10-03  |  3.0 KB  |  86 lines

  1. POPPAR(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      __ppooppppaarr, PPOOPPPPAARR - Computes bit population parity
  6.  
  7. SSYYNNOOPPSSIISS
  8.      C/C++:
  9.  
  10.      ##iinncclluuddee <<iinnttrriinnssiiccss..hh>>
  11.      iinntt __ppooppppaarr ((lloonngg _i));;
  12.  
  13.      Fortran:
  14.  
  15.      PPOOPPPPAARR (([II==]_i))
  16.  
  17. IIMMPPLLEEMMEENNTTAATTIIOONN
  18.      C/C++:  UNICOS and UNICOS/mk systems
  19.  
  20.      Fortran:  UNICOS, UNICOS/mk, IRIX systems
  21.  
  22.      Cray C/C++, CF90, MIPSpro 7 Fortran 90
  23.  
  24. SSTTAANNDDAARRDDSS
  25.      C/C++ extension
  26.  
  27.      Fortran extension
  28.  
  29. DDEESSCCRRIIPPTTIIOONN
  30.    CC//CC++++
  31.      The __ppooppppaarr function returns 0 if the argument _i has an even number of
  32.      bits that are set to 1.  This is the parity of the population count
  33.      for argument _i.
  34.  
  35.    FFoorrttrraann
  36.      This intrinsic function computes the bit population parity and returns
  37.      an integer value.  It accepts the following argument:
  38.  
  39.      _i    A Boolean, integer, real, or Cray pointer value.  On IRIX
  40.           systems, _i cannot be declared as RREEAALL((KKIINNDD==1166)).
  41.  
  42.      PPOOPPPPAARR is an elemental function.  The name of this intrinsic cannot be
  43.      passed as an argument.
  44.  
  45. NNOOTTEESS
  46.      The bit representation of the logical data type is not consistent
  47.      among UNICOS and UNICOS/mk systems.  For further details, see your
  48.      compiler's reference manuals.
  49.  
  50.    CC//CC++++
  51.      Because __ppooppppaarr is an intrinsic function, no externally visible
  52.      library function is available for it.  The compiler generates inline
  53.      code to produce the result.
  54.  
  55. FFOORRTTRRAANN RREETTUURRNN VVAALLUUEESS
  56.      In Fortran, PPOOPPPPAARR returns the value 0 if an even number of bits in _i
  57.      are set.  It returns the value 1 if an odd number of bits are set in
  58.      _i.
  59.  
  60.      The return value is of type integer.
  61.  
  62. EEXXAAMMPPLLEESS
  63.      The following section of Fortran code shows the PPOOPPPPAARR function used
  64.      with an argument of type integer.  The bit pattern of the argument and
  65.      the value of the result are also given.  For simplicity, a 16-bit
  66.      object is used.
  67.  
  68.           INTEGER I1, I2
  69.           ...
  70.           I2 = POPPAR(I1)
  71.  
  72.  
  73.            ---------------------------------------------------------------
  74.           | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
  75.            ---------------------------------------------------------------
  76.                                         I1
  77.  
  78.      The PPOOPPPPAARR function returns the value 0 to the integer variable II22.
  79.  
  80. SSEEEE AALLSSOO
  81.      A complete list of C/C++ intrinsic functions available on UNICOS and
  82.      UNICOS/mk systems is in the _C_r_a_y _C/_C++ _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  83.  
  84.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  85.      man page.
  86.